package T6;

public class Test6 {
    public static void main(String[] args) {
        LinkedList linkedList = new LinkedList();
        linkedList.add(1);
        linkedList.add(2);
        linkedList.add(3);
        linkedList.display();

       Node p = linkedList.search(2);
       linkedList.set(p,22);
       linkedList.display();

       linkedList.insertAfter(p,23);
       linkedList.display();

       linkedList.remove(22);
       linkedList.display();

        //       已经实现打印链表的方法 无需循环打印
        linkedList.display();

//       int n = linkedList.size();
//        for (int i = 0; i < n; i++) {
//            Node currentNode = linkedList.get(i);
//            System.out.print(currentNode+" ");
//        }
//        System.out.println();
    }
}
